Style sheets are used to define the layout of documents. A style sheet may be used to specify a number of different parameters that are associated with the layout of a document. Some of these parameters include page size, margins, fonts, as well as how headers and links appear within the document. Once created, the style sheet may be associated with one or more documents that may be of different types. For example, one style sheet could be associated with business letters, another style sheet could be associated with personal letters, and another style sheet could be associated with business reports.
There are many different types of style sheets. One example of a style sheet is a Cascading Style Sheet (CSS) that may be used to define how Web pages are displayed. A CSS can help provide HTML documents an attractive and consistent appearance. The CSS contains style definitions that are applied to elements in an HTML document. The CSS styles define how elements are displayed and where they are positioned on the Web page. Instead of assigning attributes to each element on Web pages individually, a general rule may be created within the CSS that applies attributes whenever a Web browser encounters an instance of a particular element.
A parser is used to create the internal data structures that are used to represent the elements contained within the style sheet by reading the entire style sheet file. The data structures are then used when the document is rendered.